package org.shangrila.bme.eo;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.math.BigDecimal;


/**
 * The persistent class for the bme_saleout database table.
 * 
 */
@Entity
@Table(name="bme_saleout")
@NamedQuery(name="BmeSaleout.findAll", query="SELECT b FROM BmeSaleout b")
public class BmeSaleout implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	private String address;

	private BigDecimal amount;

	@Column(name="ANNEX_FLAG")
	private int annexFlag;

	@Column(name="CONT_NAME")
	private String contName;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="CREATE_TIME")
	private Date createTime;

	private String operator;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="OUT_DATE")
	private Date outDate;

	
	private String remarks;

	private String status;

	//bi-directional many-to-one association to BmeContract
	@ManyToOne
	@JoinColumn(name="CONT_ID")
	private BmeContract bmeContract;

	//bi-directional many-to-one association to BmeCustomer
	@ManyToOne
	@JoinColumn(name="CUST_ID")
	private BmeCustomer bmeCustomer;

	//bi-directional many-to-one association to BmeSaleoutDetail
	@OneToMany(mappedBy="bmeSaleout")
	private List<BmeSaleoutDetail> bmeSaleoutDetails;

	public BmeSaleout() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public BigDecimal getAmount() {
		return this.amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public int getAnnexFlag() {
		return this.annexFlag;
	}

	public void setAnnexFlag(int annexFlag) {
		this.annexFlag = annexFlag;
	}

	public String getContName() {
		return this.contName;
	}

	public void setContName(String contName) {
		this.contName = contName;
	}

	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getOperator() {
		return this.operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public Date getOutDate() {
		return this.outDate;
	}

	public void setOutDate(Date outDate) {
		this.outDate = outDate;
	}

	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public BmeContract getBmeContract() {
		return this.bmeContract;
	}

	public void setBmeContract(BmeContract bmeContract) {
		this.bmeContract = bmeContract;
	}

	public BmeCustomer getBmeCustomer() {
		return this.bmeCustomer;
	}

	public void setBmeCustomer(BmeCustomer bmeCustomer) {
		this.bmeCustomer = bmeCustomer;
	}

	public List<BmeSaleoutDetail> getBmeSaleoutDetails() {
		return this.bmeSaleoutDetails;
	}

	public void setBmeSaleoutDetails(List<BmeSaleoutDetail> bmeSaleoutDetails) {
		this.bmeSaleoutDetails = bmeSaleoutDetails;
	}

	public BmeSaleoutDetail addBmeSaleoutDetail(BmeSaleoutDetail bmeSaleoutDetail) {
		getBmeSaleoutDetails().add(bmeSaleoutDetail);
		bmeSaleoutDetail.setBmeSaleout(this);

		return bmeSaleoutDetail;
	}

	public BmeSaleoutDetail removeBmeSaleoutDetail(BmeSaleoutDetail bmeSaleoutDetail) {
		getBmeSaleoutDetails().remove(bmeSaleoutDetail);
		bmeSaleoutDetail.setBmeSaleout(null);

		return bmeSaleoutDetail;
	}

}